# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Content.V21.Model.BuiltInUserInputAction do
  @moduledoc """
  Action that is implemented and performed in (your) third-party application. The application needs to show an additional content and input form to the merchant. They can start the action only when they provided all required inputs. The application will request processing of the action by calling the [triggeraction method](https://developers.google.com/shopping-content/reference/rest/v2.1/merchantsupport/triggeraction).

  ## Attributes

  *   `actionContext` (*type:* `String.t`, *default:* `nil`) - Internal details. Not for display but need to be sent back when triggering the action.
  *   `flows` (*type:* `list(GoogleApi.Content.V21.Model.ActionFlow.t)`, *default:* `nil`) - Actions may provide multiple different flows. Merchant selects one that fits best to their intent. Selecting the flow is the first step in user's interaction with the action. It affects what input fields will be available and required and also how the request will be processed.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :actionContext => String.t() | nil,
          :flows => list(GoogleApi.Content.V21.Model.ActionFlow.t()) | nil
        }

  field(:actionContext)
  field(:flows, as: GoogleApi.Content.V21.Model.ActionFlow, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.Content.V21.Model.BuiltInUserInputAction do
  def decode(value, options) do
    GoogleApi.Content.V21.Model.BuiltInUserInputAction.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Content.V21.Model.BuiltInUserInputAction do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
